package com.etc.filter;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000116671009";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCz+nZ82t81RD/4hXsucZ1oKTbdd0G33F7b5Vio22VlA8qQgPlREHYUQ0uU68EEfJmEBSz2VJM/SgS7RsnCZnhlSxjldEK69HvbC3CJUhoR8Bu7LSPoKMSTOxZEc0wo7FRMvD4IXwNXpotkdBVDDuLGzt5eS8NGeOiT0vtf5ISZHdi85Azal8SnM3xdw45nJ9Q8NqjLWzQ+U/e4BxwtlqMC74x6MYCdb39MX/n5MW6W92/yvLME9nHSSr3lCZwiLmfnd00isrty+OAewlLAT6IU05SvFx4xFEZzWgJarynX9wSuYe8HoyTDscpXbfQkqYt3Kp4I+eh5NnWV8I6ypsR9AgMBAAECggEAH+Lg+S/h2dMUrlgfwdO5OooKwWPujb+KQtU4RvpP1Xy9d6qSAU20TdS6YFEAamYU4LH2DFJhoBXiDrf06O80p2WNrKFTbUIBa4Z0Uq/sFH+AukG+GdSXNyqBwHDY7msoaEv1hZAnzHCiQ5LZbX8GqIhgFz6/Aw5Kzl3T0WJwJ5w4UuLVKKLlnRpNETJhbKMtgvDy1VR2AuuHe9HMlBE9zTj0SKmk+lzRJaoIMtfVARIY4tczrpQPSi2v7vdAo7vuunX2qWbHEE8PqazJNVM4lkrDg+7LGwCx0fw1Ikt3hJl6djyFozy5VHLN+oNa2we6tK5wUwoK5XQb/DSnIAlN1QKBgQD2K/ZJ4Hri+f7TF6Rsk2gQ4whRzEzlNBUQIviQzstSex7u4YJS/UvnMnW5xoMdeB6wpGoM/hheikeoNLdx5UTEQA5Fr1K1dWSCK+khu3Q6sHrZmBZEOjXZppxYMjhrWWkC7MgylxnR9IZ9HtwNVmW0j3tLlOv5sQA/4Z8c6tr6swKBgQC7KfX8DJDZTF9dVFUuJtAY77FmAUET8V0UWqrVlkVlxk3ymaJJvJXm7znejMTD4f3mMzlNxfa0tkC6hxZE5PNJP4x1J12hx7xGTAA4GA0rFEhJhumXAkWobL42l9Ze5HujtJ1VK/slJNhNp6mpSHyNisVqAx2+HG9qMaAPfz+cDwKBgDf9g8UF061wYu8sP2+aj17X5HqGVy8Ci4/iBFsbTc9yxXRbwkKR7gOlzHT2m7fGLGTM4HoYCP7nwKiXZOn41Y01bImY+Nzg2H1q81mCw0rd/PMkzluySbE5XfIJah+wdFv/8wDesTa5wSUQMciuz+8je02Tj6B5C697566yFCBVAoGAVDAItKpWUVgYIVv4wLy2qDDRBAgWZMkRzEEITPC+IIx1rWVL6Y0JhIog5qk9LLsvwOdTpFcipKDCNuTisHSntk/+dwgRBt9YIeq3woOXEMSby28DDWj5OkxHtzjPNXni330ztAcHfeq33R5Io5u2YtiD+i6Sp1wVBZhy3eWoECMCgYEAhqTFPV+2op+ML63IStAvYaGAL91ZYdAkS1YLArTV7nx+0oMJKNqzVhI6iJ0V3CsoWBl0TWq8G5PO7W1t1nkSZHYOM7wK+Vms7mNCymeE+ddA+wB1AgEaY4EEa4XGduQzqkTzypVC3fLn9X+4WYAPkLLsbOdT+X/R4/DSaBw7RW8=";
	// 服务器异步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
     public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmYGjO64huWJUe6tzeRghFfhn4FxlaTZY77jPONZhgP+7+Vh9g69NQJPLp0LDnCgaPRHGC6THhZZry6D67ELUXWys/innC/B9h+gcNFcEjKytCwF7ALz8pYhmI7ul6kTrNR1wVwezfJ6Z6AnJK674Hkdcf7ymRAKzhwJlPAuDZDIdsJ5CsaMleIdz0muGjaZ7OGlDFQWoazK53MqZjGsbGGMQkmHZPIdokyxfijRPIw+C9WOUOFnpZErikQvrBZ4SIs7BjWzqAa5U5f7M52eT+m3EVxA2/EVnn++MhGwmzsnXVYM40wCjRtE2O8EQZo/gMmzmNMz8xzsINyQosjYn7wIDAQAB";
	// 日志记录目录

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://127.0.0.1/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/moiveticketsystem/PayController/returnUrl";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

